<!-- brandset 页面内容 -->
<section class="brandset" ng-controller="brandsetCtrl">
  <ol class="breadcrumb">
      <li ui-sref="mine.list({ ctrl: 'functions' })"><a>更多功能</a></li>
      <li><a>品牌设置</a></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-heading">
      <div class="row">
        <div class="col col-md-3 col-xs-4">品牌设置</div>
        <div class="col col-md-9 col-xs-8 pull-right text-right">
          <button class="" ui-sref="mine.brandadd({type:2})">
            新增角色
          </button>
          <button class="" ui-sref="mine.brandadd({type:1})">
            新增部门
          </button>
        </div>
      </div>
    </div>
    <table class="table table-bordered">
      <thead>
        <tr>
          <th class="text-center"> 部门/角色 </th>
          <th class="text-center"> 权限 </th>
          <th class="text-center"> 操作 </th>
        </tr>
      </thead>
      <tbody id="accordion" ng-repeat="(key, dt) in departments track by dt.id" role="tablist" aria-multiselectable="true">
        <tr style="cursor: pointer;" data-toggle="collapse" data-parent="#accordion" href=".collapseOne{{key}}" aria-expanded="true" aria-controls="collapseOne{{key}}">
          <td class="text-center">{{dt.name}}</td>
          <td class="text-center"></td>
          <td class="text-center"></td>
        </tr>
        <tr ng-repeat="(idx, dr) in departments[key].depart_roles track by dr.id" class="panel-collapse collapse collapseOne{{key}}" role="tabpanel" aria-labelledby="headingOne{{key}}">
          <td class="text-right"> {{dr.name}} </td>
          <td class="text-center"> {{dr.rules | usertype}} </td>
          <td class="text-center" style="cursor: pointer;" ng-click="updateDepartment(dr);"> 修改 </td>
        </tr>
      </tbody>
    </table>
      <nav ng-show='departments && departments.length > 0 && page.total_count > page.current_total && !iskeyword' style="text-align: center;">
          <ul uib-pagination total-items="page.total_count" items-per-page='page.current_total' ng-model="page.current_page" ng-change="getRoles(page.current_page);" max-size="maxSize" class="pagination-sm" boundary-links="true" force-ellipses="true" next-text="下一页" last-text="尾页" previous-text="上一页" first-text="首页"></ul>
      </nav>
    </div>
  </div>
      
</section>